import math

a,b = map(int,input().split())
n = b
sq_nums = []
for i in range(1,int(math.sqrt(n))+1):
    sq_nums.append(i**2)
ans = []
def level_cnt(num):
    cnt = 1
    while num:
        cnt *= 10
        num //= 10
    return cnt

for i in range(len(sq_nums)):
    for j in range(len(sq_nums)):
        ans.append(sq_nums[i]*level_cnt(sq_nums[j])+sq_nums[j])
ans.sort()
for val in ans:
    if val < a: continue
    if val > b: break
    print(val)